package com.joven.core;

import cn.hutool.core.util.RandomUtil;
import com.joven.core.constant.enums.AccountType;

/**
 * Created by wzj on 2021/10/15.
 *
 * @author joven
 */
public class OtherTest1 {
    public static void main(String[] args) {
        int i = RandomUtil.randomInt(1, 4);
        String type = String.valueOf(i);
        System.out.println(type);
        int num = 7;
        String result = chooseOne(type, num);
        System.out.println(result);

        chooseAccout(AccountType.AC02);
    }

    private static String chooseOne(String type, int num) {
        String result = "";
        switch (type) {
            case "1":
                result = add(num);
                break;
            case "2":
                result = subtract(num);
                break;
            case "3":
                result = multiply(num);
                break;
            default:
                result = print(num);
                break;
        }
        return result;
    }

    private static String add(int num) {
        int x = ++num;
        return String.valueOf(x);
    }

    private static String subtract(int num) {
        int y = --num;
        return String.valueOf(y);
    }

    private static String multiply(int num){
        int m = num*2;
        return String.valueOf(m);
    }

    private static String print(int num){
        return String.valueOf(num);
    }

    private static void chooseAccout(AccountType type){
        switch (type){
            case AC01:
                System.out.println("对公账号330822");
                break;
            case AC02:
                System.out.println("对私账号2500204303");
                break;
            default:
                break;
        }
    }
}
